package org.dei.perla.rockfall.gui.queryforge;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

class MiscStatusPanel extends JPanel implements ParameterConfigurationManipulator{
	
	private CommandPanel cmdPanel;
	private AcquisitionTypePanel atPanel;
	private DSPicParameters parameters;

public MiscStatusPanel() {
		super();
		BoxLayout layout = new BoxLayout(this, BoxLayout.Y_AXIS);
		this.setLayout(layout);
		atPanel = new AcquisitionTypePanel("Acquisition");
		cmdPanel = new CommandPanel("Command");
		this.add(atPanel);
		this.add(cmdPanel);
	}

public MiscStatusPanel(DSPicParameters parameters) {
	this();
	this.parameters = parameters;
}

public void updateConfiguration() {
	this.atPanel.setStatus(this.parameters.getAcquisitionType());
	this.cmdPanel.setStatus(this.parameters.getCommand());
}

@Override
public void readConfiguration() {
	if(this.parameters != null){
		this.parameters.setAcquisitionType(this.atPanel.getStatus());
		this.parameters.setCommand(this.cmdPanel.getStatus());
	}
}

}
